﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using ImportDataCore;
using ImportDataUtil;

namespace ImportData
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.ApplicationExit+=new EventHandler(Application_ApplicationExit);
            StartProcess();
        }

        static void StartProcess()
        { 
            //连接数据库

            //初始化数据库连接，如果没有，则建立　
            if (!AppRoot.Init3_Database())
            {
                return;
            }

            Application.Run(new ImportMainFrom());

        }

        static void Application_ApplicationExit(object sender, EventArgs e)
        {
            LogHelper.ErrorLog.SaveLogToFile();
        }
    }
}